const userUtils = {
    checkedMobile(mobile){
        var reg = /^1[3456789]\d{9}$/;
        if(reg.test(mobile)){
          return true;
        }else{
          return false;
        }
    },
    checkedPwd(pwd){
        var reg = /^[a-zA-Z][a-zA-Z0-9_]{5,10}/
        if(reg.test(pwd)){
            return true;
          }else{
            return false;
          }
    },

    setToken(user){
        localStorage.setItem("token",user)
    },

    getToken(){
        return localStorage.getItem("token")
    },
    isLogin(){
        var token = localStorage.getItem("token");
        if(token){
          return true;
        }else{
          return false;
        }
      }
    

}

export default userUtils